import request from '/@/utils/request'

const apiText = 'contract'

// 查
export function getContractListApi(params: any) {
  return request({
    url: `/api/${apiText}`,
    method: 'get',
    params,
  })
}

// 详情
export function getContractDetailsApi(id: any) {
  return request({
    url: `/api/${apiText}/show/${id}`,
    method: 'get',
  })
}

// 下拉
export function getContractAllApi() {
  return request({
    url: `/api/${apiText}/all`,
    method: 'get',
  })
}

// 增
export function addContractListApi(data: any) {
  return request({
    url: `/api/${apiText}`,
    method: 'post',
    data,
  })
}

// 改
export function editContractListApi(data: any) {
  return request({
    url: `/api/${apiText}/${data.id}`,
    method: 'put',
    data,
  })
}

// 删
export function delContractListApi(id: string) {
  return request({
    url: `/api/${apiText}/${id}`,
    method: 'delete',
  })
}

// 项目下拉列表
export function getProjectAllApi(params: any) {
  return request({
    url: `/api/project/all`,
    method: 'get',
    params,
  })
}

// 项目成员下拉列表
export function getProjectUserAllApi(data: any) {
  return request({
    url: `/api/project/projectUserList`,
    method: 'post',
    data,
  })
}
